﻿using UnityEngine;
using UnityEditor;

public class SuperpowWindowEditor
{
    [MenuItem("Superpow/Clear all playerprefs")]
    static void ClearAllPlayerPrefs()
    {
        PlayerPrefs.DeleteAll();
        PlayerPrefs.Save();
    }

    [MenuItem("Superpow/Unlock all levels")]
    static void UnlockAllLevel()
    {
        Prefs.UnlockedLevel = Const.TOTAL_LEVEL - 1;
    }

    [MenuItem("Superpow/Print all used words")]
    static void PrintAllUsedWords()
    {
        var levels = Resources.LoadAll<GameLevel>("");

        System.Text.StringBuilder sb = new System.Text.StringBuilder();
        foreach(var level in levels)
        {
            sb.Append(level.word).AppendLine();
        }
        Debug.Log(sb.ToString());
    }

    [MenuItem("Superpow/Credit balance (ruby, coin..)")]
    static void AddRuby()
    {
        CurrencyController.CreditBalance(1000);
    }

    [MenuItem("Superpow/Set balance to 0")]
    static void SetBalanceZero()
    {
        CurrencyController.SetBalance(0);
    }
}